package com.guohengspace.mq.utils;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

//@Data
@Component
@ConfigurationProperties(prefix = "eip")
public class EipConfig {

    @Value("${eip.asapiEndpoint}")
    String eipAsapiEndpoint;

    /**
     * 组织列表
     */
    List<EipConfigDepartment> departments;

    /**
     * 资源集列表
     */
    List<EipConfigResourceGroup> resourceGroups;

    /**
     * 地域列表
     */
    List<EipConfigRegion> regions;

    /**
     * 线路类型列表
     */
    List<EipConfigISP> isps;

    /**
     * 网络类型列表
     */
    List<EipConfigNetMode> netModes;

    @Value("${eip.AccessKeyId}")
    String AccessKeyId;
    @Value("${eip.AccessKeySecret}")
    String AccessKeySecret;

    @Value("${eip.regionId}")
    String regionId;

    public String getEipAsapiEndpoint() {
        return eipAsapiEndpoint;
    }

    public void setEipAsapiEndpoint(String eipAsapiEndpoint) {
        this.eipAsapiEndpoint = eipAsapiEndpoint;
    }

    public List<EipConfigDepartment> getDepartments() {
        return departments;
    }

    public void setDepartments(List<EipConfigDepartment> departments) {
        this.departments = departments;
    }

    public List<EipConfigResourceGroup> getResourceGroups() {
        return resourceGroups;
    }

    public void setResourceGroups(List<EipConfigResourceGroup> resourceGroups) {
        this.resourceGroups = resourceGroups;
    }

    public List<EipConfigRegion> getRegions() {
        return regions;
    }

    public void setRegions(List<EipConfigRegion> regions) {
        this.regions = regions;
    }

    public List<EipConfigISP> getIsps() {
        return isps;
    }

    public void setIsps(List<EipConfigISP> isps) {
        this.isps = isps;
    }

    public List<EipConfigNetMode> getNetModes() {
        return netModes;
    }

    public void setNetModes(List<EipConfigNetMode> netModes) {
        this.netModes = netModes;
    }

    public String getAccessKeyId() {
        return AccessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        AccessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return AccessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        AccessKeySecret = accessKeySecret;
    }

    public String getRegionId() {
        return regionId;
    }

    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    //    static HashMap<String, EipConfigRegion> regionHashMap;
//
//    public HashMap<String, EipConfigRegion> GetRegionHashMap(){
//        if (regionHashMap==null){
//            regionHashMap=new HashMap<String, EipConfigRegion>();
//            regions.forEach(region->{
//                regionHashMap.put(region.getId(), region);
//            });
//        }
//
//        return regionHashMap;
//    }
}
